1 using UnityEngine;
2 using
System.Collections;
3 using
UnityEngine.UI;
4
5 public
class ScoreDisplay : MonoBehaviour {
6     ScoreKeeper scoreKeeper;
7     Text text;
8
9     
// Use this for initialization
10     
void Start () {
11         scoreKeeper = FindObjectOfType<ScoreKeeper>();
12         text = GetComponent<Text>();
13     }
14     
15     
// Update is called once per frame
16     
void Update () {
17         text.text =
"Score: " + scoreKeeper.score;
18     }
19 }


Gõ tìm kiếm nhanh...